import { Module } from '@nestjs/common'
import { JwtModule } from '@nestjs/jwt'
import { AuthController } from './auth.controller'
import { AuthService } from './auth.service'
import { AuthProvider } from './auth.model'
import * as APP_CONFIG from '@app/app.config'
import { UserModule } from '@app/modules/user/user.module'
import { JwtStrategy } from './jwt.strategy'
import { PassportModule } from '@nestjs/passport'
import { HttpModule } from '@nestjs/axios';

@Module({
  imports: [
    PassportModule.register({ defaultStrategy: 'jwt' }),
    JwtModule.register({
      privateKey: APP_CONFIG.AUTH.jwtSecret,
      signOptions: {
        expiresIn: APP_CONFIG.AUTH.expiresIn as number,
      },
    }),
    UserModule,
    HttpModule,
  ],
  controllers: [AuthController],
  providers: [ AuthProvider, AuthService, JwtStrategy],
  exports: [AuthService],
})
export class AuthModule {}
